use std::collections::HashMap;

use serde::{Deserialize, Serialize};

use crate::{
    module::ApiModule,
    operation::ApiOperation,
    request::ApiRequest,
    response::ApiResponse,
    ty::{ApiTypeId, ApiTypeInfo},
};

#[derive(Debug, Clone, Serialize, Deserialize, PartialEq, Eq)]
pub struct ApiDocument {
    pub modules: Vec<ApiModule>,

    pub operations: Vec<ApiOperation>,

    pub types: HashMap<ApiTypeId, ApiTypeInfo>,

    pub layers: Vec<ApiLayer>,
}

#[derive(Debug, Clone, Serialize, Deserialize, PartialEq, Eq)]
pub struct ApiLayer {
    pub ident: String,
    pub name: String,
    pub docs: String,
    pub request: ApiRequest,
    pub response: ApiResponse,
}
